{extends 'base/site2.html'}
{block name="page_header"}{include file="common/header.html" inline}{/block}
{block name="page_nav"}{include file="common/slide-nav.html" inline}{/block}
{block name="page_styles"}
    <link rel="stylesheet" type="text/css" href="/css/mediation/mediationorgan/addandedit.css" />
{/block}
{block name="page_scripts"}
    <script type="text/javascript" src="/js/mediation/mediationorgan/addandedit.min.js" init="mediation/mediationorgan/addandedit"></script>
{/block}
{block name="page_section"}
    <input type="hidden" role-ele="add">
    <div class="sessionPage">
        <div class="page-header">
          <div class="left">
            <span class="line"></span>
            <strong class="tit">调解部门{if empty($info)}添加{else}编辑{/if}</strong>
          </div>
        </div>
        <div class="row mr-none">
            <form class="form-horizontal col-lg-7 pad-no small-style" action="/mediationorgan/addAndEdit" method="post" role="ajaxfrom" valid-after="true">
                <input type="hidden" name="id" value="{if !empty($info['id'])}{$info['id']}{/if}">

                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-3 control-label">调解部门名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="mediationorgan[name]" value="{if !empty($info['name'])}{$info['name']}{/if}" class="form-control" id="inputEmail3" placeholder="请输入~" data-valid="notempty">
                        <span class="error-tips"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-3 control-label">负责人</label>
                    <div class="col-sm-9">
                        <input type="tel" name="mediationorgan[director]" value="{if !empty($info['director'])}{$info['director']}{/if}" class="form-control" id="inputEmail3" placeholder="请输入~">
                        <span class="error-tips"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-3 control-label">负责人联系方式</label>
                    <div class="col-sm-9">
                        <input type="tel" name="mediationorgan[mobile]" value="{if !empty($info['mobile'])}{$info['mobile']}{/if}" class="form-control" id="inputEmail3" placeholder="请输入~" >
                        <span class="error-tips"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-3 control-label">类型</label>
                    <div class="col-sm-9">
                        <select name="mediationorgan[type]" class="form-control">
                            {foreach from=$type key=key item=item}
                                <option {if !empty($info['type']) &&  $info['type'] == $key} selected="selected" {/if} value="{$key}">{$item}</option>
                            {/foreach}
                        </select>
                        <span class="error-tips"></span>

                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-3 control-label">状态</label>
                    <div class="col-sm-9">
                        <select name="mediationorgan[status]" class="form-control">
                                <option {if !empty($info['status']) &&  $info['status']== 1} selected="selected" {/if} value="1">启用</option>
                                <option {if !empty($info['status']) &&  $info['status'] == 2} selected="selected" {/if} value="2">关闭</option>
                        </select>
                        <span class="error-tips"></span>
                    </div>
                </div>
                <div class="form-group" id="white_ip" >
                    <label for="inputEmail3" class="col-sm-3 control-label">白名单IP</label>
                    <div class="col-sm-9">
                        <textarea  placeholder="若有多个用 | 隔开，支持两位通配符,ip后两网段填* (192.168.*.*) 列84.112.16.11|192.168.21.*|192.168.*.*" name="mediationorgan[whiteIp]" class="form-control" rows="3" style="width: 100%;">{if !empty($info['whiteIp'])}{$info['whiteIp']}{/if}</textarea>

                        <span class="error-tips"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-3 control-label">备注</label>
                    <div class="col-sm-9">
                        <textarea name="mediationorgan[desc]" class="form-control" cols="50" rows="1">{if !empty($info['desc'])}{$info['desc']}{/if}</textarea>
                        <span class="error-tips"></span>
                    </div>
                </div>
                <div class="form-group mr-t50 mr-b20">
                    <button type="submit" class="btn btn-primary col-lg-2 col-md-offset-2" style="margin-right:20px;">保存</button>
                    <a href="/mediationorgan/index">
                        <button type="button" class="btn btn-default   col-lg-2 col-md-offset-2">返回</button>
                    </a>
                </div>
            </form>
        </div>
    </div>
{/block}
